package com.knowledge.graph.exception;

import com.knowledge.graph.model.vo.ResponseVO;
import com.knowledge.graph.model.vo.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 拦截文件操作的相关异常，进行处理
 * @author jiwenlong
 * @date 2023/11/9 13:37
 * @version 1.0
 */
@RestController
public class FileExceptionHandler {

    @ExceptionHandler({FileException.class})
    public ResponseVO deleteFileExceptionHandler(FileException fileException){
        return new ResponseVO(StatusCode.FAIL_DELETE.getCode(), StatusCode.FAIL_DELETE.getMessage(),fileException.getMessage());
    }
}
